home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Utilities / Converters / Convert_MacPaint / Source / shared.subproj / RCS / ConvertController.h,v < prev    next >
Text File  |  1995-06-12  |  6KB  |  251 lines

  1. head     1.4;
  2. branch   ;
  3. access   ;
  4. symbols  beta10:1.3;
  5. locks    death:1.4;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.4
  10. date     93.04.04.23.44.13;  author death;  state Exp;
  11. branches ;
  12. next     1.3;
  13.  
  14. 1.3
  15. date     93.01.10.15.07.49;  author death;  state Exp;
  16. branches ;
  17. next     1.2;
  18.  
  19. 1.2
  20. date     92.07.26.13.57.23;  author death;  state Exp;
  21. branches ;
  22. next     1.1;
  23.  
  24. 1.1
  25. date     92.07.26.13.51.28;  author death;  state Exp;
  26. branches ;
  27. next     ;
  28.  
  29.  
  30. desc
  31. @Basic and primitive convert controller object.
  32. @
  33.  
  34.  
  35. 1.4
  36. log
  37. @Sun Apr  4 23:44:13 PDT 1993
  38. @
  39. text
  40. @
  41. /* Generated by Interface Builder */
  42.  
  43. #import "ResultObject.h"
  44. #import "common.h"
  45. #import "ProgressIndicator.h"
  46. // NSmajor defined in  common.
  47. #if (NSmajor == 2)
  48. #    import <appkit/defaults.h>
  49. #else
  50. #    import <defaults/defaults.h>
  51. #endif
  52.  
  53. @@interface ConvertController:ResultObject
  54. {
  55.     id    ProgressWindow;        // Window where our progress will be displayed
  56.     id    SourceFileName;    // object where name of paint file being convertes is shown
  57.     id    DestFileName;  // object which deals with displaying the name of the EPS file
  58.     id    Status;        // object which deals with displaying status info (e.g. errors)
  59.     id    DestPath;
  60.     id    SourcePath;
  61.     id    ProgressMeter;
  62.     id    SourceTitle;
  63.     id    SourcePathTitle;
  64.     id    DestTitle;
  65.     id    DestPathTitle;
  66.     id    StatusTitle;
  67.     id    prefPanel;        // the panel which displays the preferences values for the user
  68.     id    listener;            // The listener instance that we use for receiving docs from wkspce
  69.     id    decisionWindow;
  70.     id    decisionText;        //    The text of why the file was judged imperfect.
  71.     id    converterInst;
  72.     //
  73.     //    Menus cells.  So we can dim them at the right times
  74.     //
  75.     id    quitCommand;
  76.     id    hideCommand;
  77.     id    infoCommands;
  78.     id    editCommands;
  79.     id    servicesCommands;
  80.     id    windowsCommands;
  81.     //
  82.     //    These are all enabled only when file dialogs are up.  That's the only time the user
  83.     //    should be wanting to modify text.
  84.     //
  85.     id    cutCommand;
  86.     id    pasteCommand;
  87.     id    spellingCommand;
  88.     id    checkSpellingCommand;
  89.  
  90.  
  91.  
  92.     CString    ConversionString;
  93.     CString    SourcePrompt, DestPrompt, DestExtension, DefaultsOwner;
  94.     CString    SourceExtension; // Unused at the moment
  95.     CString    filePaths;        //    A string of files that are being dragged-and-dropped
  96.     CString    AppHome;
  97.     
  98.     Real            lastPercent;    //    Stores the last percentage we had for the progress meter
  99.     Boolean        cancelResult;    //    Indicates what decision the user made (whether to continue the conversion or cancel it
  100.     Boolean        destIsDead;    // An ugly hack.  For when converter has closed the dest file.
  101. }
  102.  
  103.  
  104. //
  105. //    For delegate responsibilities
  106. //
  107. - appWillInit: sender;
  108. - appDidInit: sender;
  109. - appWillTerminate: sender;
  110. - (BOOL) appAcceptsAnotherFile:sender;
  111. - (int)app:sender openFile:(const char *)filename type:(const char *)aType;
  112. //
  113. //    For speaker-listener delgation stuff (drag and drop)
  114. //
  115. - (int)iconEntered:(int)windowNum at:(double)x :(double)y
  116.     iconWindow:(int)iconWindowNum iconX:(double)iconX iconY:(double)iconY
  117.     iconWidth:(double)iconWidth iconHeight:(double)iconHeight
  118.     pathList:(char *)pathList;
  119. - (int)iconReleasedAt:(double)x :(double)y ok:(int *)flag;
  120. - (int)iconExitedAt:(double)x :(double)y;
  121. #if (NSmajor == 3)
  122. //
  123. //    For NS 3.0 drag and drop stuff
  124. //
  125. - (NXDragOperation)draggingEntered:(id)sender;
  126. - (NXDragOperation)draggingUpdated:(id)sender;
  127. - (BOOL)prepareForDragOperation:(id)sender;
  128.  - (BOOL)performDragOperation:(id)sender;
  129. - concludeDragOperation:(id)sender;
  130. - draggingExited:(id)sender;
  131. #endif
  132. //
  133. //    Utilities for the above
  134. //
  135. - allowDragAndDrop;
  136. - refuseDragAndDrop;
  137. - ProcessDroppedFiles;        // behaves at much the same layer as PrepareForConversion, below.
  138. //
  139. //    Methods to support simple converter-as-slave dialog.
  140. //
  141. - (int)msgQuit:(int *)flag;
  142. - msgConvert: (char *) sourceFile  To: (char*) destFile;
  143. //
  144. //    the main guts of the class...
  145. //
  146. - init;        // Override this in subclasses. (must open convertInst convert instance)
  147. -free;
  148.  
  149. - displayPreferences: sender;        // Override this in subclasses (if one has prefs to disply)
  150. - (CString) GetPref: (ConstCString) thePreference;
  151. - SetPref: (ConstCString) thePreference To: (CString) value;
  152. - SetBoolPref: (ConstCString) thePreference To: (Boolean) value;
  153. - (Boolean) GetBoolPref: (ConstCString) thePreference;
  154.  
  155. - SetPercentageDone: (Real) percentage;
  156.  
  157. - openDestFile: (roCString) theFile;        // Override these in sub. if need to open non File files
  158. - openSourceFile: (roCString) theFile;    // Unlike others, Do NOT call [super...]
  159. - closeSourceFile: fileInstance;            // if overrode above, then override these
  160. - closeDestFile: fileInstance  andDelete: (Boolean) deleteit;  // also don't [super ...]
  161.  
  162. - preConversion;        // might want to subclass these (but no more likely not)
  163. - postConversion;
  164.  
  165. - (Boolean) CheckFileOK: fileInst;
  166. - UserDecided: sender;
  167.  
  168. - PrepareForConversion: sender;
  169. - ConvertThisFile: (roCString) theFile;
  170. - DoConversionFrom: sourceFile  To: destinationFile;
  171. - ConvertFrom: sourceFile To: destinationFile;  // Must override
  172. @@end
  173.  
  174.  
  175.  
  176. //
  177. //    Errors:
  178. //
  179. #define    ERR_USERABORTED             10001
  180. #define    ERR_TRIEDTOOVERWRITE    10002
  181. #define    ERR_CREATEFAILED        10003
  182. #define    ERR_OPENFAILED            10004
  183. @
  184.  
  185.  
  186. 1.3
  187. log
  188. @Sun Jan 10 15:07:49 PST 1993
  189. @
  190. text
  191. @d82 1
  192. d84 10
  193. d111 1
  194. @
  195.  
  196.  
  197. 1.2
  198. log
  199. @Hopefully a pretty final version (it lived through the Font contrller...
  200. @
  201. text
  202. @d7 6
  203. a12 1
  204. #import <appkit/defaults.h>
  205. d33 20
  206. a52 1
  207.     
  208. d57 1
  209. d61 1
  210. d68 1
  211. d89 5
  212. d97 1
  213. d100 1
  214. a100 1
  215. - SetPref: (CString) thePreference To: (CString) value;
  216. d119 1
  217. @
  218.  
  219.  
  220. 1.1
  221. log
  222. @Initial revision
  223. @
  224. text
  225. @d24 5
  226. a28 1
  227.  
  228. d32 4
  229. d39 28
  230. a66 2
  231. - init;
  232. - displayPreferences: sender;
  233. d70 14
  234. d85 2
  235. a86 10
  236. - ConvertThisFile: (CString) theFile;
  237.  
  238. - ConvertFrom: sourceFile To: destinationFile;
  239. - ConvertOneFile: (CString) filename OfType: (CString) type;
  240. - openDestFile: (CString) theFile;
  241. - openSourceFile: (CString) theFile;
  242. //
  243. //    For delegate responsibilities
  244. //
  245. - appDidInit: sender;
  246. d94 4
  247. a97 2
  248. #define    ERR_USERABORTED     10001
  249. #define    ERR_TRIEDTOOVERWRITE     10002
  250. @
  251.